package com.wxl.common.room.entity;

import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.wxl.common.base.BaseEventKeyBean;
import com.wxl.common.room.converter.JbqysTypeConverter;
import com.wxl.common.room.converter.LgsTypeConverter;
import com.wxl.common.room.converter.LicenseFileTypeConverter;
import com.wxl.common.room.converter.SbbhsTypeConverter;
import com.wxl.common.room.converter.ZbqysTypeConverter;

import java.io.Serializable;
import java.util.List;

@Entity(tableName = "unApplyTable")
public class UnApplyBlastEntity extends BaseEventKeyBean {


    /**
     * cwxx : 申请错误信息错误信息代码如下
     * sqrq : 申请日期
     * sbbhs : [{"sbbh":"起爆器编码"}]
     * zbqys : {"zbqy":[{"zbqymc":"准爆区域名称","zbqyjd":"准爆区域中心位置经度","zbqywd":"准爆区域中心位置纬度","zbqybj":"准爆区域半径","zbqssj":"准爆起始时间","zbjzsj":"准爆截止时间"}]}
     * jbqys : {"jbqy":[{"jbqyjd":"禁爆区域中心位置经度","jbqywd":"禁爆区域中心位置纬度","jbqybj":"禁爆区域半径","jbqssj":"禁爆起始时间","jbjzsj":"禁爆截止时间"}]}
     * lgs : {"lg":[{"fbh":"雷管发编号注：现只针对离线下载","uid ":"雷管 UID 码","gzm":"工作码","yxq":"工作码有效期","gzmcwxx":"雷管工作码错误信息，比如：雷管已用、雷管已被公安机关列入黑名单等 "}]}
     */
    @NonNull
    @PrimaryKey(autoGenerate = true)
    private Long id;

    private String cwxx;
    private String sqrq;
    @ColumnInfo
    @TypeConverters(value = ZbqysTypeConverter.class)
    private ZbqysBean zbqys;
    @ColumnInfo
    @TypeConverters(JbqysTypeConverter.class)
    private JbqysBean jbqys;
    @ColumnInfo
    @TypeConverters(LgsTypeConverter.class)
    private LgsBean lgs;
    @ColumnInfo
    @TypeConverters(SbbhsTypeConverter.class)
    private List<SbbhsBean> sbbhs;
    @ColumnInfo
    @TypeConverters(LicenseFileTypeConverter.class)
    private LicenseFileModel licenseFileModel; // 合同信息
    @ColumnInfo
    private int isAuth;//是否已经申请过授权

    public int getIsAuth() {
        return isAuth;
    }

    public void setIsAuth(int auth) {
        isAuth = auth;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCwxx() {
        return cwxx;
    }

    public void setCwxx(String cwxx) {
        this.cwxx = cwxx;
    }

    public String getSqrq() {
        return sqrq;
    }

    public void setSqrq(String sqrq) {
        this.sqrq = sqrq;
    }

    public ZbqysBean getZbqys() {
        return zbqys;
    }

    public void setZbqys(ZbqysBean zbqys) {
        this.zbqys = zbqys;
    }

    public JbqysBean getJbqys() {
        return jbqys;
    }

    public void setJbqys(JbqysBean jbqys) {
        this.jbqys = jbqys;
    }

    public LgsBean getLgs() {
        return lgs;
    }

    public void setLgs(LgsBean lgs) {
        this.lgs = lgs;
    }

    public LicenseFileModel getLicenseFileModel() {
        return licenseFileModel;
    }

    public void setLicenseFileModel(LicenseFileModel licenseFileModel) {
        this.licenseFileModel = licenseFileModel;
    }

    public List<SbbhsBean> getSbbhs() {
        return sbbhs;
    }

    public void setSbbhs(List<SbbhsBean> sbbhs) {
        this.sbbhs = sbbhs;
    }

    public static class ZbqysBean {
        private List<ZbqyBean> zbqy;

        public List<ZbqyBean> getZbqy() {
            return zbqy;
        }

        public void setZbqy(List<ZbqyBean> zbqy) {
            this.zbqy = zbqy;
        }

        public static class ZbqyBean {
            /**
             * zbqymc : 准爆区域名称
             * zbqyjd : 准爆区域中心位置经度
             * zbqywd : 准爆区域中心位置纬度
             * zbqybj : 准爆区域半径
             * zbqssj : 准爆起始时间
             * zbjzsj : 准爆截止时间
             */

            private String zbqymc;
            private String zbqyjd;
            private String zbqywd;
            private String zbqybj;
            private String zbqssj;
            private String zbjzsj;

            public String getZbqymc() {
                return zbqymc;
            }

            public void setZbqymc(String zbqymc) {
                this.zbqymc = zbqymc;
            }

            public String getZbqyjd() {
                return zbqyjd;
            }

            public void setZbqyjd(String zbqyjd) {
                this.zbqyjd = zbqyjd;
            }

            public String getZbqywd() {
                return zbqywd;
            }

            public void setZbqywd(String zbqywd) {
                this.zbqywd = zbqywd;
            }

            public String getZbqybj() {
                return zbqybj;
            }

            public void setZbqybj(String zbqybj) {
                this.zbqybj = zbqybj;
            }

            public String getZbqssj() {
                return zbqssj;
            }

            public void setZbqssj(String zbqssj) {
                this.zbqssj = zbqssj;
            }

            public String getZbjzsj() {
                return zbjzsj;
            }

            public void setZbjzsj(String zbjzsj) {
                this.zbjzsj = zbjzsj;
            }
        }
    }

    public static class JbqysBean {
        private List<JbqyBean> jbqy;

        public List<JbqyBean> getJbqy() {
            return jbqy;
        }

        public void setJbqy(List<JbqyBean> jbqy) {
            this.jbqy = jbqy;
        }

        public static class JbqyBean {
            /**
             * jbqyjd : 禁爆区域中心位置经度
             * jbqywd : 禁爆区域中心位置纬度
             * jbqybj : 禁爆区域半径
             * jbqssj : 禁爆起始时间
             * jbjzsj : 禁爆截止时间
             */

            private String jbqyjd;
            private String jbqywd;
            private String jbqybj;
            private String jbqssj;
            private String jbjzsj;

            public String getJbqyjd() {
                return jbqyjd;
            }

            public void setJbqyjd(String jbqyjd) {
                this.jbqyjd = jbqyjd;
            }

            public String getJbqywd() {
                return jbqywd;
            }

            public void setJbqywd(String jbqywd) {
                this.jbqywd = jbqywd;
            }

            public String getJbqybj() {
                return jbqybj;
            }

            public void setJbqybj(String jbqybj) {
                this.jbqybj = jbqybj;
            }

            public String getJbqssj() {
                return jbqssj;
            }

            public void setJbqssj(String jbqssj) {
                this.jbqssj = jbqssj;
            }

            public String getJbjzsj() {
                return jbjzsj;
            }

            public void setJbjzsj(String jbjzsj) {
                this.jbjzsj = jbjzsj;
            }
        }
    }

    public static class LgsBean {
        private List<LgBean> lg;

        public List<LgBean> getLg() {
            return lg;
        }

        public void setLg(List<LgBean> lg) {
            this.lg = lg;
        }

        public static class LgBean extends BaseEventKeyBean implements Serializable {
            /**
             * fbh : 雷管发编号注：现只针对离线下载
             * uid  : 雷管 UID 码
             * gzm : 工作码
             * yxq : 工作码有效期
             * gzmcwxx : 雷管工作码错误信息，比如：雷管已用、雷管已被公安机关列入黑名单等
             */

            private String fbh;
            private String uid;
            private String gzm;
            private String yxq;
            private String gzmcwxx;

            public String getFbh() {
                return fbh;
            }

            public void setFbh(String fbh) {
                this.fbh = fbh;
            }

            public String getUid() {
                return uid;
            }

            public void setUid(String uid) {
                this.uid = uid;
            }

            public String getGzm() {
                return gzm;
            }

            public void setGzm(String gzm) {
                this.gzm = gzm;
            }

            public String getYxq() {
                return yxq;
            }

            public void setYxq(String yxq) {
                this.yxq = yxq;
            }

            public String getGzmcwxx() {
                return gzmcwxx;
            }

            public void setGzmcwxx(String gzmcwxx) {
                this.gzmcwxx = gzmcwxx;
            }
        }
    }

    public static class SbbhsBean {
        /**
         * sbbh : 起爆器编码
         */

        private String sbbh;

        public String getSbbh() {
            return sbbh;
        }

        public void setSbbh(String sbbh) {
            this.sbbh = sbbh;
        }
    }

    public static class LicenseFileModel {

        public String date; // 有效期
        public String projectname; // 项目名称
        public String projectnumber; // 项目编号
        public String contractname; // 合同名称
        public String contractid; // 合同编号
        public String filepath; // 文件名

    }
}
